package global.com.loansapplication.ui.actviity.login.biz;

import java.util.List;

import global.com.loansapplication.base.BaseBiz;
import global.com.loansapplication.base.BaseResp;
import global.com.loansapplication.bean.CityInfo;
import global.com.loansapplication.comm.BaseSubscribe2;
import global.com.loansapplication.comm.RetrofitHelp;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Administrator on 2017/10/21.
 */

public class CityBiz extends BaseBiz{

    /**
     * 获取验证码
     *
     * @param
     * @param callback
     */
    public void getiCity( final BaseBiz.Callback<List<CityInfo>> callback) {
        com.add(RetrofitHelp.getSecretApi().businessCircleData()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseSubscribe2<BaseResp<List<CityInfo>>>() {

                    @Override
                    public void onSuccess(Object obj) {
                        callback.onSuccess((List<CityInfo>)obj);
                    }

                    @Override
                    public void onFailure(Object obj) {
                        callback.onFailure((List<CityInfo>)obj);
                    }
                })
        );
    }

}
